package VWorldGameStudio;

import java.io.Serializable;

/**
 * 持续性状态
 */
public class FCLongTermState implements Serializable {
    /**
     * @param state  什么状态
     * @param val    什么数值
     * @param rounds 持续多少回合
     *               <p>
     *               如果回合等于-1，那就是不能随回合减少而减少了,必须使用物品
     */
    public FCLongTermState(String name, int v, int r) {
        value = v;
        rounds = r;
        stateName = name;
    }

    public int value;
    public String stateName;
    public int rounds;

    public boolean isRoundEnd() {
        if (rounds == -1) {
            return false;
        }
        rounds--;
        rounds = Math.max(0, rounds);
        return rounds == 0;
    }
}
